package br.biofoco.p2p.peer;

import com.google.inject.Inject;

import br.biofoco.p2p.dht.AbstractDHT;
import br.biofoco.p2p.dht.RandomWalkDHT;
import br.biofoco.p2p.dht.SeedProvider;

public class DhtFactory {
	
	private PeerSerializer peerSerializer;
	private SeedProvider seedProvider;

	@Inject
	public DhtFactory(SeedProvider seedProvider, PeerSerializer peerSerializer ){
		this.peerSerializer = peerSerializer;
		this.seedProvider = seedProvider;
	}
	
	public synchronized AbstractDHT get(PeerNode peerNode) {
		return new RandomWalkDHT(peerNode, peerSerializer, seedProvider);
	}

}
